﻿
namespace KinonekoSoftware.Foundation
{
    public class PageContext : ContextBase, IPageContext
    {
        public static readonly PageContext Empty = new PageContext { Id = Guid.NewGuid().ToString("N") };


        public PageContext()
        {
            Parameter = new Dictionary<string, ImplicitArgument>();
        }

        public PageContext(string id) : this()
        {
            Id = id;
        }

        /// <summary>
        /// 关闭对话框处理器，在DialogViewModel中使用！
        /// </summary>
        public Action<ManagedLifetimeObject> CloseHandler { get; internal set; }

        public required string Id { get; init; }
    }
}